package mysql

import (
	_ "github.com/go-sql-driver/mysql"
	"github.com/go-xorm/xorm"

	"goweb/ext/settings"
)

func CheckErrInsert(sess *xorm.Session, a interface{}) bool {

	if _, err := sess.Insert(a); err != nil {
		if err := recover(); err != nil {
			conf.Logger.Warn("sql panic", err)
		}
		conf.Logger.Warn("sql", err)
		sess.Rollback()
		return false
	}
	return true
}
